var status = 0;
var items = Array(1302020, 1302030, 1302064, 1312032, 1322054, 1332025, 1332055, 1332056, 1372034, 1382009, 1382012, 1382039, 1402039, 1412011, 1412027, 1422014, 1422029, 1432012, 1432040, 1442024, 1442051, 1452016, 1452022, 1452045, 1462014, 1462019, 1462040, 1472030, 1472032, 1472055, 1482020, 1482021, 1482022, 1492020, 1492021, 1492022);
var prize = Array(1, 1);

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("*sparkle*");
   			cm.dispose();
   			return;
  		}
		if (mode == 1)
   			status++;
  		else
   			status--;
  		if (status == 0) {
   			cm.sendYesNo("Hello there\r\nI am gold, but i want to get golder\r\n#rdo you have any golden boxes for me?#k");
  		} else if (status == 1) {
   			cm.sendNext("Wonderful!, and do you happen to need some items?");
  		} else if (status == 2) {
			var text = "What item do you want?\r\n#b";
			for (var i = 0; i < items.length; i++) {
				text += "#L" + i + "##v" + items[i] + "#, #r" + "1" + "#b golden box(es)\r\n";
			}
			text += "#k";
   			cm.sendSimple(text);
		}
	}
}